package com.zyl.blog.common.config.anno;

import com.zyl.blog.common.validated.FileValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @version v1.0
 * @ProjectName: Personal_Blog
 * @Package: com.zyl.common.config.anno
 * @ClassName: FileConstraint
 * @Description:
 * @Author FinalFantasy
 * @Date 2025/3/10-22:05
 */
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = FileValidator.class)
public @interface FileConstraint {
    String message() default "文件不合法";
    String maxSize() default "10MB";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}